package com.example.ds.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.ds.entity.User;
import org.springframework.stereotype.Repository;

/**
 * 用户mapper
 * 这里是配置数据源为slave，默认是master
 *
 * @author 姚勇
 */
@DS("slave")
@Repository
public interface UserMapper extends BaseMapper<User> {

    /**
     * 根据名字查询用户
     */
    @DS("master")
    User selectByName(String name);
}
